package com.alibaba.citrus.cr.sales.plan.functions.salesplan.adjust;

import com.alibaba.citrus.cr.common.util.SpringContextUtil;
import com.alibaba.citrus.cr.sales.plan.repository.SalesPlanAdjustDetailRepository;
import com.alibaba.citrus.cr.sales.plan.sdo.SalesPlanAdjustDetailSDO;
import lombok.Getter;
import lombok.Setter;

/**
 * @author yuhailin
 * @description:
 * @date 2021-10-26 11:20
 */
public class SalesPlanAdjustDetailEntity {

    @Getter
    @Setter
    private SalesPlanAdjustDetailSDO salesPlanAdjustDetailSDO;

    private static SalesPlanAdjustDetailRepository salesPlanAdjustDetailRepository;

    static {
        salesPlanAdjustDetailRepository = SpringContextUtil.getBean(SalesPlanAdjustDetailRepository.class);
    }

    public static SalesPlanAdjustDetailEntity of(SalesPlanAdjustDetailSDO salesPlanAdjustDetailSDO) {
        SalesPlanAdjustDetailEntity entity = new SalesPlanAdjustDetailEntity();
        entity.setSalesPlanAdjustDetailSDO(salesPlanAdjustDetailSDO);
        return entity;
    }

    public Integer doEdit() {
        return salesPlanAdjustDetailRepository.edit(salesPlanAdjustDetailSDO);
    }
}
